/*
 * User vorschlagen
 */
function GetPredictions()
{
    var name = document.add_admin.admin_name.value;
    var xmlhttp;
    if (name.length < 2)
    {
        document.getElementById("predictions").innerHTML = "";
    }
    else
    {
        // IE7+, Firefox, Chrome, Opera, Safari
        xmlhttp = new XMLHttpRequest();

        xmlhttp.onreadystatechange = function()
        {
            if (xmlhttp.readyState == 4 && xmlhttp.status == 200)
            {
                document.getElementById("predictions").innerHTML = xmlhttp.responseText;
            }
            else
            {
                document.getElementById("predictions").innerHTML = "Searching..";
            }
        }
        xmlhttp.open("GET","admin_funcs.php?q=" + name, true);
        xmlhttp.send();
    }
}